<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        div{
            width: 100px;height: 100px;
        }
        .top{
            margin: 50px 0;
            background: teal;
        }
        .bottom{
            margin: 20px 0;
            background: red;
        }
    </style>
</head>
<body>
<div class="top"></div>
<div class="bottom"></div>
</body>
<script>
    for(var i = 1;i<=3;i++){
        setTimeout(function(){console.log(i)},0);
    }
</script>
</html>